package org.capybara.coffeehouse.insteon;

import java.util.List;

public class Util {
	
	public static String getHexString(int[] b) {
		 String result = "";
		 for (int i=0; i < b.length; i++) {
		   result += String.format("%02X ", b[i] & 0xff);
		 }
		 return result;
	}

	public static String getHexString(byte[] b) {
		 String result = "";
		 for (int i=0; i < b.length; i++) {
		   result += String.format("%02X ", b[i]);
		 }
		 return result;
	}
	

	public static String getHexString(List<Integer> data) {
		 String result = "";
		 for (int b : data) {
		   result += String.format("%02X ", b);
		 }
		 return result;
	}
	
	public static String getHexByte(byte b) {
		return String.format("0x%02X", b & 0xFF);
	}
	
	public static String getHexByte(int b) {
		return String.format("0x%02X", b);
	}
}
